package com.familybox.app.controller.commands
{


    import com.familybox.app.controller.events.MappingsEvent;
    import com.familybox.app.services.AuthService;
    import com.familybox.app.services.IAuthService;
    import com.familybox.app.view.components.LoginView;
    import com.familybox.app.view.mediators.LoginMediator;

    import org.robotlegs.mvcs.Command;

    import spark.components.Application;


    public class MapViewsCommand extends Command
    {
        [Inject]
        public var event:MappingsEvent;

        override public function execute():void
        {
            injector.mapSingletonOf(IAuthService,AuthService);

            mediatorMap.mapView(LoginView, LoginMediator, null, true, true);
            this.dispatch(new MappingsEvent(MappingsEvent.MAPPING_COMPLETE));
            (contextView as Application).addElement(new LoginView());
        }
    }
}
